<?php

namespace Xin\Hashing\ThinkPHP;

use think\Service;
use Xin\Hashing\HashManager;

class HashServiceProvider extends Service
{

	/**
	 * Register the service provider.
	 *
	 * @return void
	 */
	public function register()
	{
		$this->app->bind('hash', function () {
			$hashManager = new HashManager(
				$this->app->config->get('hashing')
			);
			$hashManager->setContainer($this->app);

			return $hashManager;
		});

		$this->app->bind('hash.driver', function () {
			return $this->app['hash']->driver();
		});
	}

}
